package com.movie.controller.SysMenuController;

import com.movie.beans.SysMenu;
import com.movie.beans.SysUser;
import com.movie.service.SysMenuService;
import com.movie.utils.ShiroUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;
import java.util.Map;

/**
 * @Description :菜单Controller
 * @Author : nlw
 * @Date : 2021/8/26
 */
@Controller
@RequestMapping(value = "/system/menu")
public class SysMenuController {

    @Autowired
    private SysMenuService menuService;

    private String prefix="/system/menu";

    @GetMapping(value = "/list")
    @ResponseBody
    public Map selectMenuList(){
        SysUser user= ShiroUtil.getSysUser();
        return menuService.selectMenuList(user);
    }


    @GetMapping(value = "/tree")
    @ResponseBody
    public List<SysMenu> menuTree(){
        SysUser user= ShiroUtil.getSysUser();
        return menuService.selectMenuTreeList(user);
    }
}
